package project.entity;

import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

/**
 * <p>
 * 社区表
 * </p>
 *
 * @author YJR
 * @since 2023-07-27
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("t_actions")
public class TActions implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId("c_id")
    private String cId;

    /**
     * 用户昵称
     */
    @TableField("c_nick_name")
    private String cNickName;

    /**
     * 用户头像地址
     */
    @TableField("c_face_img")
    private String cFaceImg;

    /**
     * 说说内容
     */
    @TableField("c_text")
    private String cText;

    /**
     * 图片列表
     */
    @TableField("c_images")
    private String cImages;
    @TableField(exist = false)
    private JSONArray images;
    /**
     * 创建时间
     */
    @TableField("dt_create")
    private LocalDateTime dtCreate;

    /**
     * 点赞列表字符串
     */
    @TableField("c_prize_list_string")
    private String cPrizeListString;

    @TableField(exist = false)
    private JSONArray prizeList;

    /**
     * 评论列表字符串
     */
    @TableField("c_comment_list")
    private String cCommentList;

    @TableField(exist = false)
    private JSONArray commentList;

    /**
     * 维度
     */
    @TableField("c_latitude")
    private String cLatitude;

    /**
     * 经度
     */
    @TableField("c_longitude")
    private String cLongitude;

    /**
     * 地址
     */
    @TableField("c_address")
    private String cAddress;

    /**
     * 视频地址
     */
    @TableField("c_video")
    private String cVideo;

    @TableField("c_open_id")
    private String cOpenId;

    public String getcId() {
        return cId;
    }

    public void setcId(String cId) {
        this.cId = cId;
    }

    public String getcNickName() {
        return cNickName;
    }

    public void setcNickName(String cNickName) {
        this.cNickName = cNickName;
    }

    public String getcFaceImg() {
        return cFaceImg;
    }

    public void setcFaceImg(String cFaceImg) {
        this.cFaceImg = cFaceImg;
    }

    public String getcText() {
        return cText;
    }

    public void setcText(String cText) {
        this.cText = cText;
    }

    public String getcImages() {
        return cImages;
    }

    public void setcImages(String cImages) {
        this.cImages = cImages;
        if(StringUtils.isNotBlank(cImages)){
            this.images = JSONArray.parse(cImages);
        }
        else{
            this.images = new JSONArray();
        }
    }

    public JSONArray getImages() {
        return images;
    }

    public void setImages(JSONArray images) {
        this.images = images;
        this.cImages = images.toJSONString();
    }

    public LocalDateTime getDtCreate() {
        return dtCreate;
    }

    public void setDtCreate(LocalDateTime dtCreate) {
        this.dtCreate = dtCreate;
    }

    public String getcPrizeListString() {
        return cPrizeListString;
    }

    public void setcPrizeListString(String cPrizeListString) {
        this.cPrizeListString = cPrizeListString;
        if(StringUtils.isNotBlank(cPrizeListString)){
            this.prizeList = JSONArray.parse(cPrizeListString);
        }
        else{
            this.prizeList = new JSONArray();
        }
    }

    public JSONArray getPrizeList() {
        return prizeList;
    }

    public void setPrizeList(JSONArray prizeList) {
        this.prizeList = prizeList;
        this.cPrizeListString = prizeList.toJSONString();
    }

    public String getcCommentList() {
        return cCommentList;
    }

    public void setcCommentList(String cCommentList) {
        this.cCommentList = cCommentList;
        if(StringUtils.isNotBlank(cCommentList)){
            this.commentList = JSONArray.parse(cCommentList);
        }
        else{
            this.commentList = new JSONArray();
        }
    }

    public JSONArray getCommentList() {
        return commentList;
    }

    public void setCommentList(JSONArray commentList) {
        this.cCommentList = commentList.toJSONString();
        this.commentList = commentList;
    }

    public String getcLatitude() {
        return cLatitude;
    }

    public void setcLatitude(String cLatitude) {
        this.cLatitude = cLatitude;
    }

    public String getcLongitude() {
        return cLongitude;
    }

    public void setcLongitude(String cLongitude) {
        this.cLongitude = cLongitude;
    }

    public String getcAddress() {
        return cAddress;
    }

    public void setcAddress(String cAddress) {
        this.cAddress = cAddress;
    }

    public String getcVideo() {
        return cVideo;
    }

    public void setcVideo(String cVideo) {
        this.cVideo = cVideo;
    }

    public String getcOpenId() {
        return cOpenId;
    }

    public void setcOpenId(String cOpenId) {
        this.cOpenId = cOpenId;
    }
}
